1. Field of the Invention
This invention relates to the field of operating systems and device drivers.
Portions of the disclosure of this patent document contain material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office file or records, but otherwise reserves all copyright rights whatsoever. Sun, Sun Microsystems, the Sun logo, Solaris, Java, JavaOS, JavaStation, Hotjava Views and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
2. Background Art
Computers are controlled by software known as an xe2x80x9coperating systemxe2x80x9d. The operating system of a computer determines how the computer performs different functions that control the operation of the computer and controls how other programs run on the computer. There is a part of the operating system known as the xe2x80x9ckernelxe2x80x9d that can be thought of as the core of the operating system. The kernel contains basic functions controlling computer operation. A problem in the prior art is having an operating system that can operate with new types of computer equipment without needing to change the kernel software. This problem can be understood by the following review of computer systems, operating systems, and kernels.
A computer system consists of a central processing unit (CPU), memory (such as main memory, cache memory, etc.), and peripheral devices, also known as input/output devices (I/O). The processor can be thought of as the xe2x80x9cbrainxe2x80x9d of the computer system. The processor is controlled by programs that consist of a series of instructions that cause the processor to perform certain functions. There is one program that controls all other programs that run on the processor. This program is known as the operating system of the computer.
The operating system can cause the processor to do certain functions or provide certain services. Other programs, referred to as xe2x80x9capplicationsxe2x80x9d, use the operating system by making requests for services. Some of the services provided by the operating system include: determining which application should run at what time; managing the sharing of memory resources among applications; handling the I/O from attached hardware devices (e.g. disk drives, printers, modems, keyboards, scanners, etc.); sending error messages to the applications or computer user when appropriate; and overall management of the computer system. The core of the operating system is the system software kernel.
The kernel is the core of the computer operating system and provides basic services for all other parts of the operating system. A kernel generally includes a routine known as an xe2x80x9cinterrupt handlerxe2x80x9d, a scheduler, and a supervisor. The interrupt handler handles requests for services or completed I/O operations that compete for the kernel""s services. The scheduler determines which programs share the kernel""s processing time. The supervisor gives use of the computer to each process when it is scheduled.
To describe some of the problems that are addressed by the present invention first requires the explanation of several concepts associated with computer systems. One is the notion of platforms and platform dependence and independence. Another is the notion of expansion buses and device drivers.
A platform is the combination of the computer hardware (processor) and operating system that comprises a particular computer system. For example, a computer system with a processor manufactured by Intel and running the operating system known as Windows is considered to be a platform. An Intel computer running the DOS operating system is considered to be another platform. Other platforms include Sparc processor based computers from Sun Microsystems, Motorola processor based computers, and computers using the Unix operating system.
In the past, software was written specifically for a particular platform and would not run on other platforms. Such software is platform dependent. If a company wanted to sell a word processor application to users with different platforms, it was necessary to write a separate version of the word processing application for each platform on which it was intended to be used.
With the advent of object oriented programming and programming languages such as the Java programming language, it became possible to create applications that could be used on many platforms. Such an application, after being written once, could be used on any of a number of platforms. Such applications were said to be platform independent.
The present application relates in one embodiment to a part of a computer system known as an expansion bus. An expansion bus allows the processor of a computer system (via software running on the processor), main memory, and other hardware associated with a platform to control hardware devices external to the platform. These devices can include keyboards, printers, scanners, network interface and graphics cards, modems, and monitors. An expansion bus consists of conductors for data and control signals, along with hardware support logic chips and possibly firmware. There are a variety of expansion buses such as ISA (Industry Standard Architecture), PCI (Peripheral Component Interconnect), S-Bus, VME bus, etc. Each expansion bus defines a certain protocol by which devices that are on the bus are accessed.
A device driver is software used to control a peripheral device that is coupled with the computer system on the bus. In the past, device drivers were platform dependent. However, a scheme for implementing platform independent device drivers has been described in the following patents.
Ser. No. 09/107,047 entitled xe2x80x9cPlatform Independent Device Driversxe2x80x9d filed on Jun. 29, 1998 and assigned to the assignee of the present patent application; now U.S. Pat. No. 6,202,147.
Ser. No. 09/106,912 entitled xe2x80x9cSecurity For Platform Independent Device Driversxe2x80x9d filed on Jun. 29, 1998 and assigned to the assignee of the present patent application; now U.S. Pat. No. 6,434,694.
Ser. No. 09/106,910 entitled xe2x80x9cEndianness Checking For Platform Independent Device Driversxe2x80x9d filed on Jun. 29, 1998 and assigned to the assignee of the present patent application; now U.S. Pat. No. 6,202,147.
These patent applications are incorporated herein by reference. As described in the patent applications, there is a technique for communicating between device drivers and core platform system software. This scheme is implemented in an operating system referred to as the JavaOS. The cited patent applications describe a scheme that allows device drivers to be platform independent. A given JavaOS device driver is independent of the platform, and is only dependent on the bus. For example, a JavaOS device driver for a device on the PCI bus will run unchanged whether the PCI device it supports is connected to a Sparc processor-based platform or an x86 based platform. The same device driver runs unchanged on both platforms.
The scheme above is made possible through the use of software entities referred to as xe2x80x9cbus managersxe2x80x9d. A bus manager is system kernel software that provides the interfaces that a device driver has for obtaining system resources (e.g. objects for accessing memory, including registers) and for otherwise doing any operation on the system. A bus manager does not control the bus. A bus manager is platform dependent with one bus manager for each platform supported for a particular bus. Because the bus managers are platform dependent, the JavaOS is not platform independent, but is platform dependent. However, many aspects of the JavaOS can be released by third parties. Those portions of the JavaOS that can be released by third parties, such as device drivers for example, are platform independent.
In the scheme described in the above referenced patent applications), a platform independent device driver specifies its request for the allocation of memory in terms of an abstract memory space of an associated bus manager. The device driver calls a bus manager interface to obtain the array of memory descriptors describing all memory objects that the device driver can allocate. The associated bus manager receives the request and then translates the request from the associated bus manager""s abstract address space to a so called xe2x80x9cplatform managerxe2x80x9d that uses real address space. The platform manager allocates real memory and the addresses are passed back to the device driver via the associated bus manager for that device driver. Because the device driver communicates with an associated bus manager to access abstract memory space, the device driver is platform independent.
The communication between the device driver and bus manager and platform manager is performed using a hierarchical abstract memory object class and related sub-classes provided by the Java programming language. These class and sub-classes are described in detail in co-pending U.S. pat. application Ser. No. 09/048,333 incorporated herein by reference. It will be appreciated, however, that the methods, systems, and software described herein can be enabled using any similar programming language using techniques known to those of skill in the computer science arts.
The platform independent device driver scheme is illustrated symbolically in FIG. 2. A device driver A is associated with a device on an expansion bus. The device driver A (a software entity) communicates via a software interface with a bus manager A associated with that expansion bus. The device driver wants to have memory space allocated for its operation. Because the device driver is platform independent, it requests address space without regard to the platform on which it is running. It is in part the job of the bus manager to handle the request and allow memory to be allocated.
Bus managers are hierarchical in that they can communicate with higher-level bus managers to obtain system resources. The highest level bus manager is the platform manager, shown in FIG. 2. Bus manager A translates the driver request and forwards it to the platform manager. The platform manager allocates actual memory space appropriate for the platform and returns a memory descriptor object that is passed through the bus manager back to the device driver.
As an example of the operation of the platform independent device drivers described above, consider the case of a device driver written for a PCI bus. The driver requests memory specifying address 0x300 of the xe2x80x9cconfigxe2x80x9d address space of the PCI bus. The PCI bus manager knows that config starts at port 0x2000 and is mapped 1-to-1, so it translates 0x2000 of the config address space to 0x2300 of the xe2x80x9cport I/Oxe2x80x9d address space. If the device is on a Sparc platform, the same 0x300 address would still be requested by the device driver (which is platform independent), but the bus manager would know to map the config address space to physical address 0x14000, and so the translation would be to 0x14300 of the physical memory address space.
When the JavaOS is released, it may have included a finite set of bus managers intended to support devices for certain platforms. If a variant of a platform is released, a device on a particular bus on the variant platform may no longer be manageable by the bus manager associated with the device. As an example, there was a video device of the Cyrix MediaGx x86 platform. The device was first introduced on the PCI bus and was supported by a device driver that uses the PCI bus manager for the IBM x86 platform. Later, the same video device was put onto the motherboard. While it retains many characteristics of a PCI device, there are some new characteristics that are not part of the PCI protocol and therefore cannot be handled by existing bus managers, written for the platform, and released as core platform software.
When a platform is changed, or when a new platform is introduced, and if the existing bus manager for a device driver can no longer handle the driver, the only prior art solution is to rewrite the system software kernel to add an appropriate bus manager that can handle the driver on the platform variant. Bus managers are part of the core platform software, and are written and released (for the JavaOS), by companies such as Sun Microsystems, IBM, or by a JavaOS OEM. Because of the time and resources required to create, debug, and release core software kernel, it is not practical to support all new platforms and platform variations. The, time it would take to immediately support all platform variants as they are created would not satisfy xe2x80x9ctime to marketxe2x80x9d business constraints. The alternative to rewriting core system software is to fail to support the new platform until a scheduled OS upgrade. Neither of these solutions is desirable.
The present invention provides a means to support new and modified platforms without the need to modify the system software kernel. The invention uses an approach referred to as Platform Service Agents (PSAs). The PSA works with the bus manager of the system software for that platform variant and modifies the system resources as needed. The PSA isolates specifics of the platform, so that the bus manager need not be modified. Because the PSAs themselves are outside of the kernel, are downloadable, and easily created for platform variants, new platforms can be supported without modification or re-release of the system software kernel.